<!-- inc:head -->
<style id="loading-style">html,body{width:100%;height:100%; overflow: hidden;}</style>
<section class="user-loader" style="background:url({:$_sys[logo]});background-size: 100% 100%;">
	<i class="icon-spin4 animate-spin"></i>
</section>
<div class="ad"><img src="{:$_sys[sharetips]}" alt="" /></div>
<section class="main animated">
	<div class="main-box">
		{if($_SESSION['user_id'])}
		<div class="home-info border-box fn-clear">
			<figure class="figure-box">
				<img src="{if($urs[picture])}{:$urs[picture]}{else}images/header.png{end}" alt="" />
			</figure>
			<h5>{:$urs[username]}&nbsp;</h5>
			<div class="user-info">
				<label>总佣金</label>
				<p><i class="icon icon-money"></i><span>{:$money}</span></p>
			</div>
			<div class="info-border"></div>
			<div class="user-info">
				<label>客户数</label>
				<p><i class="icon icon-users"></i><span>{:$total}</span></p>
			</div>
			{if($urs[fxstatus])}
			<div class="user-ad-yes">
				<p><a href="{:$_sys[shareyeslink]}" title="{:$_sys[sharegiftyes]}">{:$_sys[sharegiftyes]}</a></p>
			</div>
			{else}
			<div class="user-ad">
				<p><a href="javascript:void(0)" id="dialog">{:$_sys[sharegift]}</a></p>
			</div>
			{end}
			<a href="{if($_SESSION['user_id'])}{:site_url('usercp')}{else}{:site_url('login')}{end}" title="设置" class="jjr-setting"><i class="icon-setting"></i></a>
		</div>
		{else}
		<div class="unregister">
			<figure><a href="{:site_url('register')}"><img src="images/unregister.jpg" alt="" /></a></figure>
		</div>
		{end}
		<ul class="home-nav fn-clear">
			<li class="nav-recommend"><a href="{if($_SESSION['user_id'])}{:site_url('recommend')}{else}{:site_url('register')}{end}" title="{:$_sys[tj_title]}">{:$_sys[tj_title]}<label>hot</label><br /><span>Recommend</span></a></li>
			<li class="nav-rule"><a href="{if($_SESSION['user_id'])}{:site_url('customer')}{else}{:site_url('login')}{end}" title="{:$_sys[kh_title]}">{:$_sys[kh_title]}<br /><span>Client</span></a></li>
			<li class="nav-commission"><a href="{if($_SESSION['user_id'])}{:site_url('commission')}{else}{:site_url('login')}{end}" title="{:$_sys[yj_title]}"><p>{:$_sys[yj_title]}<br /><span>Commission</span></p></a></li>
			<li class="nav-rule-detail"><a href="{:site_url('msg','id=2')}" title="{:$_sys[xz_title]}">{:$_sys[xz_title]}<br /><span>Rule</span></a></li>
		</ul>
		<div class="sale-box">
			<h6>{:$_sys[itemtitle]}</h6>
			<div class="floor-box">
				<!-- run:$item = phpok_m_list("projects",100,1) -->
				<!-- $item[rslist] AS $key=>$value -->
				<a href="{if($value[link_url])}{:$value[link_url]}{else}{:msg_url($value)}{end}" class="floor-detail" title="{:$value[title]}" target="{if($value[target]==1)}_blank{else}_self{end}">
                <figure class="floor-img"><img src="{:$value[picture]}" alt="{:$value[title]}" /></figure>
                <div class="floor">
                	<h5>{:$value[title]}</h5>
					{if($value[yongjin])}
                    <div class="award fn-clear">
                    	<label class="award-title">佣金</label>
						<div class="award-list"><span>{:$value[yongjin]}</span><br /></div>
                    </div>
					{end}
					{if($value[jili])}
                    <div class="award fn-clear">
                    		<label class="award-title">激励</label>
							<div class="award-list"><span>{:$value[jili]}</span><br /></div>
                    </div>
					{end}
                </div>
                </a>
				<!-- end --> 
				<!-- run:unset($item) -->    
			</div>
		</div>
	</div>
</section>
<footer class="foot"><a href="{:$_sys[siteurl]}">&copy; Powered by {:$_sys[copyright]}</a></footer>
<script src="http://g.tbcdn.cn/kissy/k/1.4.0/seed.js"></script>
<script src="js/mod.jjr.js"></script>
<script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
var _Conf = {
            img: "{:$_sys[siteurl]}{:$_sys[wx_logo]}",
            w: 100,
            h: 100,
            url: '{:$_sys[wx_link]}',
            title: "{:$_sys[wx_title]}",
            desc: "{:$_sys[wx_description]}",
            appid: '' };

function _ShareFriend() {
    WeixinJSBridge.invoke('sendAppMessage',{
          'appid': _Conf.appid,
          'img_url': _Conf.img,
          'img_width': _Conf.w,
          'img_height': _Conf.h,
          'link': _Conf.url,
          'desc': _Conf.desc,
          'title': _Conf.title
          }, function(res){
				if(res.err_msg=="send_app_msg:ok"){
					var pars = "";
					var parsprams = "";
					var randomcode = Math.random() * 100000;
					parsprams = pars + "&code=" + randomcode + "&f=updategroup";
					$.ajax({
							url: 'index.php?c=home',
							type: "Get",
							data: parsprams,
							beforeSend: function () { },
							success: function (state) {
								alert(state);
							}
						});				
				}			  
            _report('send_msg', res.err_msg);
      })
}
function _ShareTL() {
    WeixinJSBridge.invoke('shareTimeline',{
          'img_url': _Conf.img,
          'img_width': _Conf.w,
          'img_height': _Conf.h,
          'link': _Conf.url,
          'desc': _Conf.desc,
          'title': _Conf.title
          }, function(res) {
				if(res.err_msg=="share_timeline:ok"){
					var pars = "";
					var parsprams = "";
					var randomcode = Math.random() * 100000;
					parsprams = pars + "&code=" + randomcode + "&f=updategroup";
					$.ajax({
							url: 'index.php?c=home',
							type: "Get",
							data: parsprams,
							beforeSend: function () { },
							success: function (state) {
								alert(state);
							}
						});				
				}			  
            _report('timeline', res.err_msg);
          });
}
function _ShareWB() {
    WeixinJSBridge.invoke('shareWeibo',{
          'content': _Conf.desc,
          'url': _Conf.url,
          }, function(res) {
			  
				if(res.err_msg=="share_weibo:ok"){
					var pars = "";
					var parsprams = "";
					var randomcode = Math.random() * 100000;
					parsprams = pars + "&code=" + randomcode + "&f=updategroup";
					$.ajax({
							url: 'index.php?c=home',
							type: "Get",
							data: parsprams,
							beforeSend: function () { },
							success: function (state) {
								alert(state);
							}
						});				
				}			  
            _report('weibo', res.err_msg);
          });
}
// 当微信内置浏览器初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
	//隐藏下方工具栏，需要显示顶部导航栏，请把hideToolbar换成showToolbar
	WeixinJSBridge.call('showToolbar');
	//隐藏右上角菜单，需要显示请把hideOptionMenu换成showOptionMenu
	WeixinJSBridge.call('showOptionMenu');
        // 发送给好友
        WeixinJSBridge.on('menu:share:appmessage', function(argv){
            _ShareFriend();
      });
        // 分享到朋友圈
        WeixinJSBridge.on('menu:share:timeline', function(argv){
            _ShareTL();
            });
        // 分享到微博
        WeixinJSBridge.on('menu:share:weibo', function(argv){
            _ShareWB();
       });
}, false);
</script>
</body>
</html>